package com.xjoyt.pay.master.repository;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;

import com.xjoyt.pay.master.dao.DistributorPassportRepositoryCustom;
import com.xjoyt.pay.master.po.DistributorPassport;
import com.xjoyt.pay.repository.Repository;

public interface DistributorPassportRepository
		extends Repository<DistributorPassport>, DistributorPassportRepositoryCustom {

	@Query(" select a from DistributorPassport a where a.distributor.id = ?1 and enabled = true ")
	Page<DistributorPassport> findAllByDistributorIdAndEnabled(String distributorId, Pageable pageable);

	@Query(" select a from DistributorPassport a where a.distributor.id = ?1 and enabled = true ")
	List<DistributorPassport> findAllByDistributorIdAndEnabled(String distributorId);
}
